function toAddPage(){
	window.location.href = appServer + "/goods/publish/rule/add.htm";
}
function startPublish(){
    var r=confirm("确定开始发布？");
    if (r==true){
        $.ajax({
            url: appServer + "/goods/publish/rule/startPublish.json",
            type: "POST",
            dataType:"json",
            success: function(data){
                if(data.code == 0){
                    alert("开始发布成功。");
                }else{
                    alert(data.msg);
                }
            },
            error: function(res){
                alert(res.responseText);
            }
        });
    }else{
        return;
    }
}
function deleteRule(id){
	var r=confirm("确认删除？");
	if (r==true){
		window.location.href=appServer + "/goods/publish/rule/delete.htm?id="+id;
	}else{
		return;
	}	
}

function checkvalue(obj){
	obj.value = obj.value.replace(/[^\d.]/g,""); //清除"数字"和"."以外的字符
	obj.value = obj.value.replace(/^\./g,""); //验证第一个字符是数字
	obj.value = obj.value.replace(/\.{2,}/g,"."); //只保留第一个, 清除多余的
	obj.value = obj.value.replace(".","$#$").replace(/\./g,"").replace("$#$",".");
	obj.value = obj.value.replace(/^(\-)*(\d+)\.(\d\d).*$/,'$1$2.$3'); //只能输入两个小数	
}